<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 100px;
            height: 100px;

            color: #fff;

            
        }
        .idx {
            background: #000;
            position: absolute;
            z-index: 2;
        }
        .idx1 {
            position: absolute;
            z-index: -1;
        }
    </style>
</head>
<body>
    <div class="idx"><div class="idx1">1</div>
        <div class="id2">2</div>
    </div>
</body>
</html>